import React from "react";
import s from "./index.scss";
import Row from "antd/lib/Row";
import Col from "antd/lib/Col";
import Link from 'components/Link'

class Footer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }




  render() {
    let {base} = this.props
    let linkStr
    let userData
    if(localStorage.getItem('userData')!=undefined&&localStorage.getItem('userData')!="undefined"){
     userData = JSON.parse(localStorage.getItem('userData'))
    }
    
    if(userData==null||userData==undefined){
      linkStr = <Link href={`https://www.sobot.com/chat/h5/index.html?sysNum=eaf1b04a96de44f2ac9956a634eac3ee&tel=&uname=&partnerId=`}>在线咨询</Link>
    }else{
      linkStr = <Link href={`https://www.sobot.com/chat/h5/index.html?sysNum=eaf1b04a96de44f2ac9956a634eac3ee&tel=${userData.mobile}&uname=${userData.nickName}&partnerId=${userData.mobile}`}>在线咨询</Link>
    }
    return (
      <Row className={`${s.footerBox}`}>
        <Col span={24} className={`${s.Top}`}>
          <Col span={6}><Link href="https://mp.weixin.qq.com/s?__biz=MzAwODM2MzA4MA==&mid=400119972&idx=1&sn=6052df0772d971f9138160baed084b16">服务号</Link></Col>
          <Col span={6}><Link href="/aboutUs">关于我们</Link></Col>
          <Col span={6}><Link href="/helpCenter">帮助中心</Link></Col>
          <Col span={6}><Link href="/contactUs">联系我们</Link></Col>
        </Col>
        {base==true?<div><Col span={24} className={`${s.copyright}`}>
        ©2015 安心投 版权所有 市场有风险 投资需谨慎
        </Col>
        <Col span={24} className={`${s.copyright}`}>
        京ICP备15014199号-1
        </Col></div>
        :
        <div>
        <Col span={24} className={`${s.hotline}`}>
          服务热线：<a href="tel:4008136661" style={{color:'#777'}}>400-813-6661</a> &nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;
          {linkStr}
        </Col>
        <Col span={24} className={`${s.copyright}`}>
          市场有风险 出借需谨慎
        </Col>
        <Col span={24} className={`${s.copyright}`}>
          ©2015 安心投 版权所有 京ICP备15014199号-1
        </Col>
        </div>
        }
      </Row>
    );
  }
}

export default Footer;
